<?php
class DigUi_View_Helper_DigUiDocumentReady extends Zend_View_Helper_Abstract
{
    public function digUiDocumentReady() {
        return $this;
    }

    public function open() {
        if($this->_isXmlHttpRequest()) {
            // render script tags only
        } else {
            // render jquery doc-ready
        }
    }

    public function close() {
        if($this->_isXmlHttpRequest()) {
            // render script tags only
        } else {
            // render jquery doc-ready
        }
    }

    protected function _isXmlHttpRequest() {
        return Zend_Controller_Front::getInstance()->getRequest()->isXmlHttpRequest();
    }
}
?>
